home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
msdemo.zip
/
MSDEMO.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1993-01-04
|
1KB
|
56 lines
program msdemo;
uses crt,mouse;
const
EventMask = $001F; (* Specifies events to interrupt on *)
(* See your Mouse Reference Manual *)
BothButtons = 3;
LeftButton = 1;
RightButton = 2;
begin
ClrScr;
MouseRegister(EventMask);
if MousePresent <> 0 then
begin
GotoXY(20,10);
WriteLn('Press right and left mouse buttons to exit');
ShowMouse;
while Buttons <> BothButtons do
begin
if EventFlag <> 0 then
begin
GotoXY(1,1);
Write('X = ',Xcoord,
' Y = ',Ycoord,
' Offset screen address = ',MCursorAddr,' ');
if Buttons <> 0 then
begin
if Buttons = RightButton then
begin
GotoXY(1,25);
Write('Right button pressed')
end
else if Buttons = LeftButton then
begin
GotoXY(1,25);
Write('Left button pressed');
end
end
else
begin
GotoXY(1,25);
ClrEOL
end;
EventFlag := 0
end
end;
HideMouse;
MouseUnregister
end;
ClrScr;
end.